
<include file="public:header" />



<link href="<?php echo STATICSPATH;?>css/mui.min.css" rel="stylesheet" />
<script src="<?php echo STATICSPATH;?>js/mui.min.js"></script>
<script type="text/javascript" src="<?php echo STATICSPATH;?>js/jSignature.min.js"></script>




<div class="about-main main">
    <div class="state">
        
        <div>
         
           
         <div class="nc-reg">
         	 <form id="signform">
         	 <input name="_csrf" type="hidden" id="_csrf" value="csrtoken">
             <div class="form-group">
                <span class="t">姓名</span>
                <input type="text" class="input form-control" name="name">
             </div>
             <div class="form-group">
                <span class="t">手机号码</span>
                <input type="text" class="input form-control" name="cell">
             </div>
             <div class="form-group">
                <span class="t">身份证号码</span>
                <input type="text" class="input form-control" name="pid" id='identity'>
                <!--<span class="tip">请使用包含字母和数据的6-20个的字符</span>-->
             </div>
             <div class="form-group sign-group">
                <span class="t">签名</span> 
   				<div id="signature" style="height: 100%;border:1px dashed #000;" ></div>
					<input id="clear" type="button" value="重签" style="float:right;">
					<!--<input id="export" type="button" value="export">-->
					<!--<input id="save" type="button" value="save">-->
				<div id="pic" />
				<p id="base" style="width:100%;height: 100%;"></p>
				<script type="text/javascript" charset="utf-8">
					mui.plusReady(function() {
						plus.screen.lockOrientation('landscape-secondary');
					});
					$(document).ready(function() {
						$("#signature").jSignature({color:"#000",lineWidth:2,height:'100%',width:'100%'});  //设置签名区宽高，也是最终生成图片的宽高。可以写百分数，也可以写整数。
					});
					document.getElementById("clear").addEventListener('tap', function() {
						$("#signature").jSignature("reset");
						$("#pic")[0].innerHTML = '';
					});
// 					document.getElementById("save").addEventListener('tap', function() {
// 						var datapair = $("#signature").jSignature("getData", "image");
// 						var array = datapair.splice(",");
// 						mui.toast(array[1]);
// 					});
					
				</script>
             </div>
             </form>
         </div>
        </div>
    </div>
    <div class="bd" style="background:none;">
  
    
        <div class="aBtn">
            <a href="javascript:void(0);" class="btn-red" id="btn-red">提交签名</a>
        </div>
        <script>
         	document.getElementById("btn-red").addEventListener('tap', function() {
				var datapair = $("#signature").jSignature("getData", "image");
				var identity = $("#identity").val();
				//alert(identity);return;
				//console.log(datapair);
// 				var i = new Image();
// 				i.src = "data:" + datapair[0] + "," + datapair[1];
// 				$(i).appendTo($("#pic"));
				var sign_pic="data:" + datapair[0] + "," + datapair[1];
				$.post("/service/savesign",$("#signform").serialize()+'&sign_pic='+encodeURIComponent(sign_pic)+'&identity='+encodeURIComponent(identity) , function(result){
					var ret = $.parseJSON(result); 
					alert(111);return;
					alert(ret.errorMessage);
					window.history.go(-1);
				});
			});
         </script>
    </div>
</div>
<!-- //main -->


<include file="public:footer" />